const menuList = [{
    title: '首页',
    routerPath: ''
  },
  {
    title: '考研',
    routerPath: ''
  },
  {
    title: '考公',
    routerPath: ''
  },
  {
    title: '驾校',
    routerPath: ''
  },
  {
    title: '计算机',
    routerPath: ''
  }
]

const {
  selectedKeys,
  routerPath
} = {
  selectedKeys: ['首页'],
  routerPath: ''
} // 用户的菜单使用缓存
const state = {
  menuList,
  selectedKeys,
  curMenuRouterPath: routerPath
}
const getters = {
  stateMenuList: state => state.menuList,
  stateSelectedKeys: state => state.selectedKeys, // 当前选中的item
  stateRouterPath: state => state.curMenuRouterPath // 当前路由
}
const mutations = {
  updateMenuItemStatus: (state, params) => {
    const {
      selectedKeys,
      routerPath
    } = params

    state.selectedKeys = selectedKeys
    state.routerPath = routerPath
    // setStorage('menuUsedStorage', params, 0)
  }
}
const actions = {}

export default {
  namespaced: true,
  state,
  getters,
  mutations,
  actions
}